d60f16611fef98b6821408e71dc2dd12fcd8425e
[git-annex.git] /
1 [[!comment format=mdwn
2  username="yarikoptic"
3  avatar="http://cdn.libravatar.org/avatar/f11e9c84cb18d26a1748c33b48c924b4"
4  subject="comment 6"
5  date="2023-04-25T18:45:58Z"
6  content="""
7 Just for completeness -- do we really need a new type of record for this?  In immediate use case which is [in the heart of the path escaping change discussion](https://git-annex.branchable.com/bugs/started_to_escape_characters_in_the_output/) let's consider other commands.  E.g. `addurl` already reports `--json-errors` just fine in a similar case
8
9 ```shell
10 ❯ git annex addurl --json --json-error-messages '\e[31mfo\o\e[0m'
11 {\"command\":\"addurl\",\"error-messages\":[\"git-annex: bad url \\e[31mfo\\o\\e[0m\"],\"file\":null,\"input\":[\"\\e[31mfo\\o\\e[0m\"],\"success\":false}
12 addurl: 1 failed
13 ```
14
15 so why just not to make `add`'s 
16
17 ```shell
18 ❯ git annex add --json --json-error-messages '\e[31mfo\o\e[0m'
19 git-annex: \e[31mfo\o\e[0m not found
20 add: 1 failed
21 ```
22
23 into
24
25 ```shell
26 {\"command\":\"add\",\"error-messages\":[\"git-annex: \\e[31mfo\\o\\e[0m not found\"],\"file\":null,\"input\":[\"\\e[31mfo\\o\\e[0m\"],\"success\":false}
27 add: 1 failed
28 ```
29
30 or if you want to expand with unambigous ID:
31
32 ```
33 {\"command\":\"add\",\"error-messages\":[\"git-annex: \\e[31mfo\\o\\e[0m not found\"],\"file\":null,\"input\":[\"\\e[31mfo\\o\\e[0m\"],\"success\":false, \"errorid\": \"NOT_FOUND\"}
34 add: 1 failed
35 ```
36 or alike without requiring some new CLI option?
37 """]]